/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>Project: javase - Lambda1
 * <p>Powered by webrx On 2021-12-21 10:47:10
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Lambda1 {
    public static void main(String[] args) {
        System.out.println(Dao1.lf(2));
        //javascript es6 =>
        //java lambda ->   ()->0 (a,b)->a-b  (a,b)->b-a
        var d = (Dao1) (a) -> a * a;
        System.out.println(d.pf(2));
    }

    public static void nolambda(String[] args) {
        System.out.println(Dao1.lf(2));

        var d = new Dao1Impl();
        System.out.println(d.pf(2));
        System.out.println(Dao1.lf(3));


        Dao1 d1 = i -> i * i;
        System.out.println(d1.pf(3));
    }
}
